/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.beans.fiscal;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "PRODUTO_NF_ISSQN")
public class ProdutoNfIssqn implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "VALOR_BASE")
    private BigDecimal valorBase;
    @Column(name = "ALIQUOTA")
    private BigDecimal aliquota;
    @Column(name = "VALOR_ISSQN")
    private BigDecimal valorIssqn;
    @Basic(optional = false)
    @Column(name = "COD_MUNICIPIO")
    private int codMunicipio;
    @Column(name = "ITEM_LISTA_SERVICO")
    private Integer itemListaServico;
    @Column(name = "COD_SITUACAO_TRIB_ISSQN")
    private String codSituacaoTribIssqn;

    public ProdutoNfIssqn() {
    }

    public ProdutoNfIssqn(Integer id) {
        this.id = id;
    }

    public ProdutoNfIssqn(Integer id, int codMunicipio) {
        this.id = id;
        this.codMunicipio = codMunicipio;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public BigDecimal getValorBase() {
        return valorBase;
    }

    public void setValorBase(BigDecimal valorBase) {
        BigDecimal oldValorBase = this.valorBase;
        this.valorBase = valorBase;
        changeSupport.firePropertyChange("valorBase", oldValorBase, valorBase);
    }

    public BigDecimal getAliquota() {
        return aliquota;
    }

    public void setAliquota(BigDecimal aliquota) {
        BigDecimal oldAliquota = this.aliquota;
        this.aliquota = aliquota;
        changeSupport.firePropertyChange("aliquota", oldAliquota, aliquota);
    }

    public BigDecimal getValorIssqn() {
        return valorIssqn;
    }

    public void setValorIssqn(BigDecimal valorIssqn) {
        BigDecimal oldValorIssqn = this.valorIssqn;
        this.valorIssqn = valorIssqn;
        changeSupport.firePropertyChange("valorIssqn", oldValorIssqn, valorIssqn);
    }

    public int getCodMunicipio() {
        return codMunicipio;
    }

    public void setCodMunicipio(int codMunicipio) {
        int oldCodMunicipio = this.codMunicipio;
        this.codMunicipio = codMunicipio;
        changeSupport.firePropertyChange("codMunicipio", oldCodMunicipio, codMunicipio);
    }

    public Integer getItemListaServico() {
        return itemListaServico;
    }

    public void setItemListaServico(Integer itemListaServico) {
        Integer oldItemListaServico = this.itemListaServico;
        this.itemListaServico = itemListaServico;
        changeSupport.firePropertyChange("itemListaServico", oldItemListaServico, itemListaServico);
    }

    public String getCodSituacaoTribIssqn() {
        return codSituacaoTribIssqn;
    }

    public void setCodSituacaoTribIssqn(String codSituacaoTribIssqn) {
        String oldCodSituacaoTribIssqn = this.codSituacaoTribIssqn;
        this.codSituacaoTribIssqn = codSituacaoTribIssqn;
        changeSupport.firePropertyChange("codSituacaoTribIssqn", oldCodSituacaoTribIssqn, codSituacaoTribIssqn);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProdutoNfIssqn)) {
            return false;
        }
        ProdutoNfIssqn other = (ProdutoNfIssqn) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Apagar.ProdutoNfIssqn[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
